package fr.generali.sas.ws.v1_0.service;

import java.util.concurrent.Callable;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import fr.generali.sas.dao.FluxInternalDao;
import fr.generali.sas.domain.FluxHibernate;
import fr.generali.sas.ws.v1_0.Flux;

@Component
public class PersistFluxSimpleImpl implements Runnable, Callable<FluxHibernate>, PersistFlux{

	@Resource
	FluxInternalDao dao;
	
	public FluxHibernate call() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	public void run() {
		// TODO Auto-generated method stub
		
	}
	
	/**{@inheritDoc}
	 * @see fr.generali.sas.ws.v1_0.service.PersistFlux#persistFlux(fr.generali.sas.ws.v1_0.Flux)
	 */
	@Transactional
	public void persistFlux(Flux f) throws Exception {
		FluxHibernate fh = FluxMapper.transform(f);
		dao.save(fh);
		
	}

}
